﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using System.Threading.Tasks;
//using Magicodes.Admin;
//using Magicodes.Admin.Configuration;
//using Magicodes.Admin.Web;
//using Microsoft.EntityFrameworkCore;
//using Microsoft.EntityFrameworkCore.Design;
//using Microsoft.EntityFrameworkCore.Infrastructure;
//using Microsoft.Extensions.Configuration;

//namespace Magicodes.WeChat.EntityFrameworkCore
//{
//    public class DbContextFactory : IDesignTimeDbContextFactory<WeChatDbContext>
//    {
//        public WeChatDbContext CreateDbContext(string[] args)
//        {
//            var builder = new DbContextOptionsBuilder<WeChatDbContext>();
//            var configuration = AppConfigurations.Get(WebContentDirectoryFinder.CalculateContentRootFolder(), addUserSecrets: true);

//            //builder.UseSqlServer(connectionString);
//            //以支持SQL Server 2012以下数据库
//            builder.UseSqlServer(configuration.GetConnectionString(AdminConsts.ConnectionStringName), p => p.UseRowNumberForPaging());

//            return new WeChatDbContext(builder.Options);
//        }
//    }
//}
